require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
require 'watir/testcase'
require 'watir/contrib/enabled_popup'

class TC_Home < Test::Unit::TestCase
  def test_07_EditingTheFeaturedItemBoxOnTheHomePage
    $ie.goto($UniVar)
    $ie.refresh()
    
    $ie.div(:id, /ctl00_ctl00_rcr_rcr_ctl00_ctl00_content/).fire_event('onDblClick')
    temp_var = "This is the new featured text."
    $ie.frame(:index, 1).document.parentWindow.execScript("tinyMCE.getInstanceById(tinyMCE.getEditorId('mce_editor_0')).execCommand('mceSetContent', false, '" + temp_var + "')")
    $ie.frame(:index, 1).button(:caption, ' Save Changes ').click
    assert($ie.contains_text('This is the new featured text.'))
  end
end
